package com.niodata.dp.plugin.core;

import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.apache.hadoop.fs.FileSystem;

/**
 * plugin runtime context.
 */
public interface PluginContext {

  public String getPrincipal();

  //public String getKeyTabFile();

  public Input getConfig();

  //public String getHadoopHome();

  public FileSystem getHadoopFileSystem() throws IOException;

  public FileSystem getFileSystem(String dsName) throws IOException;

  public FileSystem getTmpFileSystem() throws IOException;

  public File getWorkDir();

  public DataSource getDataSource(String dsName, String dbName) throws IOException, SQLException;

  //runtime info
  public String getTaskName();

  public String getJobName();

  public String getRunTimeJobId();

  public String getFlowName();

  public String getFlowExecId();

  public String getScheduleId();

  public String getConfigId();

  public void output(Output output) throws Exception;

}
